package screen;

import java.awt.Color;
import java.util.ArrayList;

public class Pixel {

	private ArrayList<Color> colors;

	public Pixel() {
		this.colors = new ArrayList<Color>();
	}

	public void addColor(Color c) {
		this.colors.add(c);
	}

	public Color averageColors() {
		int rSum = 0, gSum = 0, bSum = 0;
		for (Color c : colors) {
			rSum += c.getRed();
			gSum += c.getGreen();
			bSum += c.getBlue();
		}
		return new Color(rSum / colors.size(), gSum / colors.size(), bSum
				/ colors.size());
	}

}
